1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to a video encoding method and apparatus and a video decoding method and apparatus, and more particularly, to a method and apparatus for efficiently encoding and decoding a residual block of a current block.
2. Description of the Related Art
FIG. 1 is a block diagram of a conventional video encoder 100.
Referring to FIG. 1, a motion estimation unit 110 and a motion compensation unit 120 perform interprediction (also known as inter-frame prediction). The motion estimation unit 110 searches a reference picture stored in a frame memory unit 150 in order to generate a motion vector of a current block. The motion compensation unit 120 performs motion compensation on the current block in order to generate a prediction block of the current block.
An intraprediction unit 140 performs intraprediction (also known as intra-frame prediction) on the current block using the pixels included in a previously encoded region that is adjacent to the current block in order to generate a prediction block similar to interprediction.
The prediction block generated by the motion compensation unit 120 or the intraprediction unit 140 is subtracted from the current block in order to generate a residual block. The encoding unit 130 encodes the generated residual block, and then the generated residual block is inserted into a bitstream.
The reconstruction unit 170 reconstructs the residual block encoded by the encoding unit 130, and then the reconstructed block is added to the prediction block. The filter unit 150 deblocking-filters the reconstructed block and the frame memory unit 150 stores the reconstructed block.
The encoding unit 130 performs encoding as follows. First, the encoding unit 130 performs discrete cosine transformation (DCT) on residual values included in the residual block. The encoding unit 130 then quantizes DCT coefficients generated by the DCT. The encoding unit 130 then performs entropy-encoding on the quantized DCT coefficients and inserts them into the bitstream.
Conventional encoding performs DCT on all the residual values included in the residual block in order to generate DCT coefficients. However, residual values for adjacent pixels are likely to have a spatial correlation with each other. By using the spatial correlation, the residual block can be reconstructed during decoding without performing DCT on all the residual values.